using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;using Maxleaf.EDI.Domain.K3;

namespace Maxleaf.EDI.DataAccess.K3
{
    public class ICCreditManagerMap : EntityTypeConfiguration<ICCreditManager>
    {
        public ICCreditManagerMap()
        {
            // Primary Key
            this.HasKey(t => t.FUserName);

            // Properties
            this.Property(t => t.FUserName)
                .IsRequired()
                .HasMaxLength(20);

            this.Property(t => t.FPassword)
                .HasMaxLength(20);

            // Table & Column Mappings
            this.ToTable("ICCreditManager");
            this.Property(t => t.FUserName).HasColumnName("FUserName");
            this.Property(t => t.FPassword).HasColumnName("FPassword");
            this.Property(t => t.FCreditAmount).HasColumnName("FCreditAmount");
            this.Property(t => t.FCreditQty).HasColumnName("FCreditQty");
            this.Property(t => t.FCreditDays).HasColumnName("FCreditDays");
        }
    }
}
